import Axios from './axios'

//账号登录
export function postLogin(params) {
    return Axios({
        url: "/api/v2/user/login",
        method: "post",
        headers: {
            'Content-Type': 'application/json'
        },
        data: params
    })
}

//账号注册
export function postRegister(params) {
    return Axios({
        url: "/api/v2/user/register",
        method: "post",
        headers: {
            'Content-Type': 'application/json'
        },
        data: params
    })
}

//获取手机验证码
export function getPhoneCode(params) {
    return Axios({
        url: "/api/v2/seeker/phone-code",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        data: null,
        params: params
    })
}

//验证码登录
export function postPhoneCode(params) {
    return Axios({
        url: "/api/v2/seeker/phone-login",
        method: "post",
        headers: {
            'Content-Type': 'application/json'
        },
        data: params
    })
}

//更新用户密码
export function postPassword(params) {
    return Axios({
        url: "/api/v1/user/update-password",
        method: "put",
        headers: {
            'Content-Type': 'application/json'
        },
        data: params
    })
}

//上传文件
export function postImage(params) {
    return Axios({
        url: "/api/v2/upload-file",
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: "post",
        data: params
    })
}

//获取文件
export function getImage(params) {
    return Axios({
        url: "/api/v2/read-file",
        headers: {
            'Content-Type': 'application/json'
        },
        responseType: 'blob',
        method: "post",
        data: params
    })
}

//获取求职者个人信息
export function getSeekerDetail(params) {
    return Axios({
        url: "/api/v1/seeker/read/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        data: null
    })
}

//更新求职者个人基本信息
export function postSeekerDetail(params) {
    return Axios({
        url: "/api/v1/seeker/update",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "put",
        data: params
    })
}

//更新求职者个人审核信息
export function postSeekerInformation(params) {
    return Axios({
        url: "/api/v1/seeker/update-audit-detail",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "patch",
        data: params
    })
}

//模糊查找企业列表
export function getCompaniesName(params) {
    return Axios({
        url: "/api/v2/company/read-companies-name",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        data: null,
        params: params
    })
}

//查找企业详细列表
export function getCompanies(params) {
    return Axios({
        url: "/api/v2/company/read-companies",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        data: null,
        params: params
    })
}

//获取企业个人信息
export function getCompanyDetail(params) {
    return Axios({
        url: "/api/v1/company/read/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        data: null
    })
}

//更新企业个人基本信息
export function postCompanyDetail(params) {
    return Axios({
        url: "/api/v1/company/update",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "put",
        data: params
    })
}

//更新企业个人审核信息
export function postCompanyInformation(params) {
    return Axios({
        url: "/api/v1/company/update-audit-detail",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "patch",
        data: params
    })
}

//查看需要审核的用户
export function getNotAuditUsers(params) {
    return Axios({
        url: "/api/v1/admin/not-audit-user",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: params,
        data: null
    })
}

//审核用户
export function postAuditUser(params) {
    return Axios({
        url: "/api/v1/admin/update-audit-status",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "put",
        data: params
    })
}

//查看用户信息
export function getUserList(params) {
    return Axios({
        url: "/api/v1/admin/read-users",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: params,
        data: null,
    })
}


//企业创建工作
export function postCreateJob(params) {
    return Axios({
        url: "/api/v1/job/create-job",
        headers: {
            'Content-Type': 'application/json',
        },
        method: "post",
        params: null,
        data: params
    })
}

//企业查看工作
export function getJob(params) {
    return Axios({
        url: "/api/v2/job/read-job/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: null,
        data: null
    })
}

//企业更新工作
export function putUpdateJob(params) {
    return Axios({
        url: "/api/v1/job/update-job",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "put",
        params: null,
        data: params
    })
}


//企业删除工作
export function deleteJob(params) {
    return Axios({
        url: "/api/v1/job/delete-job/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "delete",
        params: null,
        data: null
    })
}

//求职者查询工作
export function getJobsBySeeker(params) {
    return Axios({
        url: "/api/v2/job/seeker-query-jobs",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: params,
        data: null
    })
}

//查询企业下的工作
export function getCompanyJobs(params) {
    return Axios({
        url: "/api/v2/job/read-company-jobs",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: params,
        data: null
    })
}

//查询企业工作标签
export function getCompanyJobsLabel(params) {
    return Axios({
        url: "/api/v2/job/read-label/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: null,
        data: null
    })
}

//查看工作详细
export function getJobByJobId(params) {
    return Axios({
        url: "/api/v2/job/read-job/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: null,
        data: null
    })
}

//创建工作类型
export function postCreateJobType(params) {
    return Axios({
        url: "/api/v1/job-type/create",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "post",
        params: null,
        data: params
    })
}

//读取工作类型列表
export function getJobTypes() {
    return Axios({
        url: "/api/v2/job-type/read",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: null,
        data: null
    })
}

//修改工作类型
export function putUpdateJobType(params) {
    return Axios({
        url: "/api/v1/job-type/update",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "put",
        params: null,
        data: params
    })
}

//删除工作类型
export function deleteJobType(params) {
    return Axios({
        url: "/api/v1/job-type/delete/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "delete",
        params: null,
        data: null
    })
}

//模糊查询工作类型
export function getJobTypeByName(params) {
    return Axios({
        url: "/api/v2/job-type/query-job-type/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: null,
        data: null
    })
}

//求职者投递岗位
export function postDeliveryJob(params) {
    return Axios({
        url: "/api/v1/delivery/create-delivery",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "post",
        params: null,
        data: params
    })
}

//查看岗位投递情况
export function getReadDeliveries(params) {
    return Axios({
        url: "/api/v1/delivery/read-deliveries",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: params,
        data: null
    })
}


//修改投递情况
export function patchUpdateDelivery(params) {
    return Axios({
        url: "/api/v1/delivery/update-delivery-status",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "patch",
        params: null,
        data: params
    })
}

//查看评论情况
export function getReadRemarks(params) {
    return Axios({
        url: "/api/v1/remark/read-remark",
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: params,
        data: null
    })
}

//创建评论
export function postCreateRemark(params) {
    return Axios({
        url: "/api/v1/remark/create-remark",
        headers: {
            'Content-Type': 'application/json'
        },
        method: "post",
        params: null,
        data: params
    })
}

//删除评论
export function deleteRemark(params) {
    return Axios({
        url: "/api/v1/remark/delete-remark/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "delete",
        params: null,
        data: null
    })
}

//导出用户数据
export function exportExcel(params) {
    return Axios({
        url: "/api/v2/admin/export-excel/" + params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "get",
        params: null,
        data: null,
        responseType: 'blob'
    })
}